<script>
export default {
  name: 'lazyload',
  render: function(h) {
    return h('div', {
      style: {
        width: '100%',
        height: '100%'
      },
      directives: [
        {
          name: 'lazy',
          arg: 'background-image',
          value: this.src
        }, {
          name: 'loading',
          value: this.loading
        }
      ]
    }, [])
  },
  data() {
    return {
      loading: true
    }
  },
  props: {
    tag: {
      type: String,
      default: 'div'
    },
    src: {
      type: String
    }
  },
  created() {
    this.$Lazyload.$on('loaded', (d) => {
      console.log(d)
    })
  }
}
</script>

<style>

</style>
